package com.zl.util;

import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.UUID;

import sun.misc.BASE64Encoder;

public class Util {
	
	public static String md5(String str) {
		try {
			MessageDigest md = MessageDigest.getInstance("md5");
			byte[] bytes = md.digest((str+"zlhhh").getBytes());
			BASE64Encoder encoder = new BASE64Encoder();
			str = encoder.encode(bytes);
		} catch (NoSuchAlgorithmException e) {
			e.printStackTrace();
		}
		return str;
	}
	
	public static String uuid(){
		return UUID.randomUUID().toString();
	}
	
}

